package net.sky.oa.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 个人通讯录分组
 * MyGroupEmpl. @author hond
 */
@SuppressWarnings("unused")
@Entity
@Table(name = "MY_GROUPEMPL")//个人通讯分组表
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class MyGroupEmpl implements Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	private Long geId;
	private MyGroup group;
	private SysEmployee user;

	//vo fields 
	private Long id;
	
	private String name;
	private String sex;
	private String enname;
	private String mobile;
	private String tel;
	private String cornet;
	private String qq;
	private String groupName;
	
	// Constructors

	/** default constructor */
	public MyGroupEmpl() {
	}
	
	@Id 
	@SequenceGenerator(name="SQ_MYGROUPEMPL_ID",sequenceName="SQ_MYGROUPEMPL_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_MYGROUPEMPL_ID")
	@Column(name = "ID", unique = true, nullable = false)	
	public Long getGeId() {
		return geId;
	}

	public void setGeId(Long geId) {
		this.geId = geId;
	}

	public MyGroupEmpl(Long geId) {
		this.geId = geId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "GROUP_ID")
	public MyGroup getGroup() {
		return this.group;
	}
	
	public void setGroup(MyGroup group) {
		this.group = group;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}

	public void setUser(SysEmployee user) {
		this.user = user;
	}
	
	
	@Transient
	public Long getId() {
        return user.getId();
    }

    @Transient
	public String getName() {
		return this.user.getName();
	}

	@Transient
	public String getEnname() {
		return this.user.getEnname();
	}

	@Transient
	public String getSex() {
		return this.user.getSex();
	}

	@Transient
	public String getMobile() {
		return this.user.getMobile();
	}

	@Transient
	public String getTel() {
		return this.user.getTel();
	}

	@Transient
	public String getCornet() {
		return this.user.getCornet();
	}

	@Transient
	public String getQq() {
		return this.user.getQq();
	}
	
	@Transient
	public String getGroupName() {
		return this.group.getName();
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public void setEnname(String enname) {
		this.enname = enname;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public void setCornet(String cornet) {
		this.cornet = cornet;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
	
	
}